package com.vpa.main;

import java.sql.Timestamp;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Observable;
import java.util.Observer;

public class DataStore extends Observable{

	LinkedList<Entry> storage = new LinkedList<Entry>();
	public final int MAX_ENTRIES = 1000;
	
	
	public void add_entry(String p_id){
		Entry temp = new Entry(p_id,new java.util.Date().getTime());
		storage.add(temp);		 	
		this.setChanged();
		this.notifyObservers(temp);
	}
	
	public void register_observer(Observer other){
		System.out.println("Added Observer");
	}
	
	public ListIterator<Entry> get_new_entries(int pos){
		return storage.listIterator(pos);
	}

	public class Entry{
		
		public Entry(String p_id, long time){
			this.p_id = p_id;
			this.time = time;
		}
		
		String p_id;
		long time;
	}

}
